package com.example.interviewrecorder.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.example.interviewrecorder.model.LyyUser

@Dao
interface LyyUserDao {
    @Insert
    fun insertLyyUser(user: LyyUser)

    @Update
    fun updateLyyUser(newUser: LyyUser)

    @Delete
    fun deleteLyyUser(user: LyyUser)

    @Query("select * from LyyUser")
    fun queryAllUser(): List<LyyUser>

    @Query("select * from LyyUser where userName = :username")
    fun findUserByUsername(username: String): LyyUser?
}